<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends SB_Controller {
	
	function __construct()
	{
		parent::__construct();
	}
	
	public function index()
	{
		if ($this->user->id)
			redirect('/admin');
		$this->load->adminView('login');
	}
	
	function logino()
	{
		if ($this->user->checkUser(trim(strtolower($this->input->post('login'))), trim($this->input->post('hash'))))
		{
			$this->user->startSession($this->input->post('login'));
			redirect('/admin');
		} else
			redirect('/admin/login');
	}
}

?>